package collectio;

import inherit.CollegeStudent;

import java.util.ArrayList;
import java.util.Collection;

/**
 * Created by MadFrog on 2017/11/1.
 */
public class TestCollection {
    public static void main(String[] args) {
        // 定义2个大学生
        CollegeStudent c1 = new CollegeStudent();
        CollegeStudent c2 = new CollegeStudent();
        // 定义一个集合对象
        Collection col = new ArrayList();

        col.add(c1);
        col.add(c2);
        System.out.println("集合大小是：" + col.size());
        col.remove(c1);
        System.out.println("集合大小是：" + col.size());
        System.out.println("删除c1以后,集合里就没有c1了。" + col.contains(c1));
//        col.trimToSize();


    }
}
